package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelPictureActivity;
import flc.ast.databinding.FragmentHomeBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link HomeFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class HomeFragment extends BaseNoModelFragment<FragmentHomeBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.ivUploadPic.setOnClickListener(this);
        mDataBinding.ivAppointCompress.setOnClickListener(this);
        mDataBinding.ivIDPicCompress.setOnClickListener(this);
        mDataBinding.ivBatchCompress.setOnClickListener(this);
        mDataBinding.ivChangeSize.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivUploadPic://上传图片
                SelPictureActivity.type = 0;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivAppointCompress://指定压缩
                SelPictureActivity.type = 1;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivIDPicCompress://证件照压缩
                SelPictureActivity.type = 2;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivBatchCompress://批量压缩
                SelPictureActivity.type = 3;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivChangeSize://修改尺寸
                SelPictureActivity.type = 4;
                startActivity(SelPictureActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}